package com.example.springapplicationdemo.handlerexceptionresolver;

import com.example.springapplicationdemo.handlerexceptionresolver.exception.NewsNotFoundException;
import com.example.springapplicationdemo.vo.RestResVo;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("news_rest_controller")
public class NewsRestController {

    @PostMapping("{id}/_update")
    public RestResVo<Void> update(@PathVariable Long id){
        if (id.equals(1L)){
            throw new NewsNotFoundException(id);
        }
        return RestResVo.success(null);
    }
}
